<style>
.hoadơn_head{ width:100%;height:100px; margin-top:50px;}
.hoadơn_head .top_left{ float:left; width:50%; height:210px; margin-top:-50px; }
.hoadơn_head .top_right{ float:right; width:50%; height:210px; }
.hoadơn_head .top_left h2{ font-size:16px; text-transform:uppercase;}
.hoadơn_head .top_right h2{ font-size:34px; text-transform:uppercase; text-align:right}
.top_left span, .top_right span ,.hoadon_khach span{ font-weight:bold;}
table.admindata thead .head_tb th { font-weight:bold; font-size:14px; height:30px; text-transform:uppercase; text-align:center}
table.admindata tr.row1 td {
	background-color: #FFFFFF;
	border: 1px solid #E1E1E1;
	color: #555555;
	padding: 10px 0 10px 5px;
	text-align: left;
	font-size:14px;
}
</style>
<div style="width:1000px; margin:0 auto">
<div> 
</div>
<div class="hoadơn_head">
    <div class="top_left">
        <h2><img src="<?php echo base_url()?>templates/images/logo_print.jpg" width="100" title="" alt="logo " /></h2>
        <p><span>Địa chỉ:</span>  20/9 Đường số 3 Cư Xá Đô Thành, Phường 4, Quận 3, TP. Hồ Chí Minh</p>
        <p><span>Điện thoại:</span> 08 – 6290 8590</p>
    </div>
    <div class="top_right">
    	<h2>HÓA ĐƠN BÁN HÀNG </h2>
    </div>
</div>
<div class="hoadon_khach">
<p><span>Tên khách hàng:</span>  <?php echo $query->fullname?> </p>
<p><span>Địa chỉ: </span><?php echo $query->address.', '.$query->district_name.', '.$query->city_name; ?> </p>
<p><span>Điện thoại: </span>  <?php echo $query->phone?></p>
</div>
<div class="hoadon_sanpham">
	<?php if($order_product_items){ ?>
    <table class="admindata" >
        <thead>
         
            <tr class="head_tb">
             	<th style="width: 40px;">STT</th>
                <th style="width: 150px;">Hình ảnh</th>
                <th style="">Tên sản phẩm</th>
                <th style="width: 80px;">Số lượng</th>
                <th style="width: 80px;">Màu sắc</th>
                <th style="width: 80px;">Kích thước</th>
                <th style="width: 80px;">Giá</th>
                <th style="width: 100px;">Thành tiền</th>
            </tr>                
        </thead>
            <tbody>
             <?php
             $tongtien = 0;$stt=1;
              foreach($order_product_items as $product_item){ ?>
            <tr class="row1">
            	<td><?php echo $stt;?></td>
                <td>
               <img src="<?php echo base_url_site()?>uploads/products/avatar/<?php echo $product_item->image?>" width="100" />
                </td>
                <td>
                <?php echo $product_item->product_name?>               
                </td>
                <td>
                <?php echo $product_item->quantity; ?>
                </td>
                <td>
                <?php echo $product_item->color_name; ?>
                </td>
                <td>
                <?php echo $product_item->size_name; ?>
                </td>
                <td>
                <?php echo number_format($product_item->price, 0, ',', '.')?>
               </td>
                <td>
                <?php echo number_format($product_item->total, 0, ',', '.')?>
                </td>
                
            </tr>
            
            <?php 
                $tongtien +=$product_item->total;
				$stt++;
            } ?>
            <tr class="row1">
               <td colspan="8">
                 <div style="text-align:left; font-size:16px; color:#F00; font-weight:bold; "><span>Ghi chú : <?php echo $query->note?></span>  </div>
                </td>
            </tr>
            <tr class="row1">
               <td colspan="8">
                 <div style="text-align:right; font-size:16px; color:#F00; font-weight:bold; "><span>Tổng tiền : </span>  <?php echo number_format($tongtien, 0, ',', '.')?> VNĐ</div>
                </td>
            </tr>
             <tr class="">
             	<td colspan="6">
                 
                <div id="printOption" style="text-align:center; margin-top:20px;">
                <a href="javascript:void();" onclick="document.getElementById('printOption').style.visibility = 'hidden'; window.print(); return true;"><img src="<?php echo base_url()?>templates/images/printer-icon.png" width="150" height="50" style="border: 1px solid #ffba00;
border-radius: 5px;" /></a>
                </div>
                 </td>
            </tr>
            </tbody>
    </table>
    <?php } ?>
</div>
</div>
